package com.dstation.controller;


import com.dstation.domain.FollowTableInfo;
import com.dstation.domain.UserInfo;
import com.dstation.service.interf.IFollowTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping(value = "/followTable")
public class FollowTableController {

    @Autowired
    private IFollowTableService followTableService;

    @RequestMapping("/myFollowListPage")
    public String followTable(HttpSession session, ModelMap modelMap) {
        List<FollowTableInfo> followTableInfoList = followTableService.findMyFollowUserByUserId(
                ((UserInfo)session.getAttribute("userInfo")).getUserId()
        );
        modelMap.put("followTableInfoList", followTableInfoList);
        return "main/myFollowListPage";
    }
}
